import request from '@/router/axios';

// 维修列表
export const getList = (current, size, params) => {
  return request({
    url: '/api/mes-product/mro-center-equipment/query-page-repair-list',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getDetail = (id, handlingId) => {
  return request({
    url: '/api/mes-product/mro-center-equipment/detail',
    method: 'get',
    params: {
      id,
      handlingId
    }
  });
};

export const remove = (ids) => {
  return request({
    url: '/api/mes-product/mro-center-equipment/remove',
    method: 'post',
    params: {
      ids
    }
  });
};

// export const add = (row) => {
//   return request({
//     url: '/api/mes-admin/equipmentrepairlist/submit',
//     method: 'post',
//     data: row
//   });
// };

// export const update = (row) => {
//   return request({
//     url: '/api/mes-admin/equipmentrepairlist/submit',
//     method: 'post',
//     data: row
//   });
// };

// 开始维修
export const startRepair = (row) => {
  return request({
    url: '/api/mes-product/mro-center-equipment/start-repair',
    method: 'post',
    data: row
  });
};

// 结束维修
export const endRepair = (row) => {
  return request({
    url: '/api/mes-product/mro-center-equipment/end-repair',
    method: 'post',
    data: row
  });
};
